<?php

/**
 * Message form.
 *
 * @package    wills
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class MessageForm extends BaseMessageForm
{
  public function configure()
  {
    unset(
      $this['created_at'],
      $this['updated_at'],
      $this['contestant_id'],
      $this['author_id']
    );
	$this->setWidget('captcha', new sfWidgetCaptchaGD());
	$this->validatorSchema['captcha'] = new sfCaptchaGDValidator(array('length' => 3));

	$this->validatorSchema['message']->setOption('trim', true)
      ->setMessage('required', '留言不能为空');

	$this->validatorSchema['name']->setOption('trim', true)
	  ->setMessage('required', '姓名不能为空');
	$this->validatorSchema['emailorqq']->setOption('trim', true)
	  ->setMessage('required', '联系方式不能为空');
  }
}
